/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

import java.sql.Date;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 *
 * @author Paul
 */
public class DateUtils {

    public static Date getConvertedDateToSQLDate(String dateNaissance) throws DateUtilsException {
        DateFormat DOB = new SimpleDateFormat("dd/MM/yyyy");
        Date convertedDateNaissance;
        try {
            convertedDateNaissance = new Date(DOB.parse(dateNaissance).getTime());
        } catch (ParseException pe) {
            throw new DateUtilsException("Veuillez respecter le format de la date : jj/mm/aaaa.");
        }
        return convertedDateNaissance;
    }
}
